#!/bin/sh
#
# $OpenBSD: aircontrol.rc,v 1.7 2015/07/15 19:49:41 ajacoutot Exp $

daemon="${TRUEPREFIX}/bin/catalina.sh"
daemon_flags="-Xmx768M -server"
daemon_user="_aircontrol"

. /etc/rc.d/rc.subr

pexp="$(${LOCALBASE}/bin/javaPathHelper -c aircontrol) .*-Dcatalina.base=/var/aircontrol"

rc_reload=NO

rc_start() {
        ${rcexec} \
	    "CATALINA_OPTS=\"${daemon_flags}\" \
	    JAVA_HOME=\"$(${LOCALBASE}/bin/javaPathHelper -h aircontrol)\" ${daemon} start"
}

rc_stop() {
	CATALINA_OPTS="${daemon_flags}" \
	    JAVA_HOME="$(${LOCALBASE}/bin/javaPathHelper -h aircontrol)" \
	    ${daemon} stop
}

rc_cmd $1
